.modal.fade{ id: 'report-modal', tabindex: -1, role: 'dialog', aria: { labelledby: "report-modal-label", hidden: true } }
  .modal-dialog.modal-dialog-centered{ role: 'document' }
    .modal-content
      .modal-body
        %p.wrap-text.confirmation-text
          Are you sure you want to report this
          %span.reportable_type
          ?

        - if Configuration.code_of_conduct.present?
          %p.wrap-text
            You may want to read the
            = link_to 'Code of Conduct', code_of_conduct_index_path, target: '_blank'
            page first.

        = form_for(Report.new, url: reports_path, method: :post, remote: true) do |form|
          = hidden_field_tag :link_id
          = form.hidden_field :reportable_id
          = form.hidden_field :reportable_type
          .mb-3
            #report-category
              = form.collection_radio_buttons(:category, Report.categories.keys, :to_s, :humanize, { checked: 'spam' }) do |radio|
                .form-check
                  = radio.radio_button(class: 'form-check-input')
                  = radio.label(class: 'form-check-label')
            #report-reason
              = form.label('Reason:')
              = form.text_area(:reason, class: 'form-control')
              .text-muted
                Please include any additional information here.
          .form-check#report-comment-author-container
            = check_box_tag(:report_comment_author, '1', false, class: 'form-check-input')
            = label_tag(:report_comment_author, 'Report the author of the comment', class: 'form-check-label')
          .modal-footer
            %a.btn.btn-sm.btn-outline-secondary.px-4{ data: { 'bs-dismiss': 'modal' } }
              Cancel
            = submit_tag('Submit', class: 'btn btn-sm btn-primary px-4')

:javascript
  $(document).ready(function() {
    $('#report-category').on('change', '.form-check-input', function(e) {
      $('#report-reason textarea').attr('required', (e.target.value !== 'other' ? null : true));
    });

    collectReportModalsAndSetValues();
  });

- content_for(:content_for_head, javascript_include_tag('webui/report'))
